<?php get_backend_header(array(
	'jquery/validate/jquery.validate.js',
        'jquery/validate/additional-methods.js',
	'exam.js',
), array(
	'jquery/ui.jqgrid.css'
)); ?>

<?php get_group_sidebar($group_id); ?>
<div id ="content" >
    <h2 class="title"><?php echo ($exam_id) ?  'Edit' : 'Add'; ?> Exam</h2>

    <form id="exam_form" name="exam_form" class="form" method="POST" action ="<?php echo site_url('exam/submit') ?>">
            <input type="hidden" id="group_id" name="group_id" value="<?php echo $group_id; ?>" />
            <input type="hidden" id="exam_id" name="exam_id" value="<?php echo $exam_id; ?>" />

                <div class="unit">

                    <div class="line">
                            <label for="" class="bold">Exam name:</label>
                            <div class="field" style="height:auto">
                              <input type="text" name="exam_name" id="exam_name" value="<?php echo $exam_name; ?>"/>
                            </div>
                    </div>

                    <div class="line">
                            <label for="" class="bold">Kind of Exam:</label>
                            <div class="field" style="height:auto">
                              <input type="text" name="exam_kind" id="exam_kind" value="<?php echo $exam_kind; ?>"/>
                            </div>
                    </div>

                    <div class="line">
                            <label for="" class="bold">Identification no. of terms:</label>
                            <div class="field" style="height:auto">
                              <input type="text" name="identification_no_terms" id="identification_no_terms" value="<?php echo $identification_no_terms; ?>"/>
                            </div>
                    </div>

                    <div class="line">
                            <label for="" class="bold">Multiple Choice no. of terms:</label>
                            <div class="field" style="height:auto">
                              <input type="text" name="multiple_no_terms" id="multiple_no_terms" value="<?php echo $multiple_no_terms; ?>"/>
                            </div>
                    </div>
                    <div class="line">
                            <label for="" class="bold">Matching Type no. of terms:</label>
                            <div class="field" style="height:auto">
                              <input type="text" name="match_no_terms" id="match_no_terms" value="<?php echo $match_no_terms; ?>"/>
                            </div>
                    </div>
                    <div class="line">
                            <label for="" class="bold">True/false no. of terms:</label>
                            <div class="field" style="height:auto">
                              <input type="text" name="true_false_no_terms" id="multiple_no_terms" value="<?php echo $true_false_no_terms; ?>"/>
                            </div>
                    </div>

                </div>


            <div class ="clear"></div>

            <div class="buttons">
                <a href="<?php echo site_url('exam/list_records/'.$group_id); ?>" id="cancel" name="cancel">Cancel</a>
                <button id="save" name="save">Next</button>
            </div>
    </form>
    
</div>


<script type="text/javascript">
        examRules();

	$('#cancel').button({
		icons: {primary: 'ui-icon-arrowreturn-1-w'}
	});	
	
	$('#save').button({
		icons: {primary: 'ui-icon-arrow'}
	}).click(function(e) {
                e.preventDefault();
		$(this).removeClass('ui-state-focus');
		$('#exam_form').submit();
	});

        $('#exam_kind').qtip({
                content: 'E.g. Quiz, Short Quiz, etc..',
                position: {
                    corner: {
                        target: 'topMiddle',
                        tooltip: 'bottomMiddle'
                    }
                },
                hide: {
                    when: 'inactive',
                    delay: 1500
                },
                style: 'fieldinfo'
    });

</script>

<?php get_backend_footer(); ?>
